package org.grayrabbit.cms.entity;

// Generated 2012-1-5 15:59:28 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsPublishTask generated by hbm2java
 */
@Entity
@Table(name = "CMS_PUBLISH_TASK")
public class PublishTask implements java.io.Serializable {
	private static final long serialVersionUID = 8671946019471072795L;
	/**新建任务*/
	public static final String STATUS_NEW = "0";
	/**运行中的任务*/
	public static final String STATUS_RUNNING = "1";
	/**已停止的任务*/
	public static final String STATUS_STOP = "2";
	/**已完成的任务*/
	public static final String STATUS_FINISHED = "3";
	private String taskId;
	private PublishConfig publishConfig;
	private String taskName;
	private Date taskBeginTime;
	private Date taskEndTime;
	private String taskStatus;
	private Boolean isAutoPublish;
	private String taskOperLoginName;
	private String taskOperRealName;
	private Integer createCount;
	private Integer errorCount;
	private Integer total;
	private String taskDesc;
	private Set<OperLog> operLogs = new HashSet<OperLog>(0);
	private Set<PublishLog> publishLogs = new HashSet<PublishLog>(0);

 

	@Id
	@Column(name = "TASK_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getTaskId() {
		return this.taskId;
	}
	@Column(name = "TASK_DESC", length = 4000)
	public String getTaskDesc() {
		return taskDesc;
	}

	public void setTaskDesc(String taskDesc) {
		this.taskDesc = taskDesc;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PUBLISH_ID")
	public PublishConfig getPublishConfig() {
		return this.publishConfig;
	}

	public void setPublishConfig(PublishConfig publishConfig) {
		this.publishConfig = publishConfig;
	}

	@Column(name = "TASK_NAME", length = 64)
	public String getTaskName() {
		return this.taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "TASK_BEGIN_TIME", length = 7)
	public Date getTaskBeginTime() {
		return this.taskBeginTime;
	}

	public void setTaskBeginTime(Date taskBeginTime) {
		this.taskBeginTime = taskBeginTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "TASK_END_TIME", length = 7)
	public Date getTaskEndTime() {
		return this.taskEndTime;
	}

	public void setTaskEndTime(Date taskEndTime) {
		this.taskEndTime = taskEndTime;
	}

	@Column(name = "TASK_STATUS", length = 32)
	public String getTaskStatus() {
		return this.taskStatus;
	}

	public void setTaskStatus(String taskStatus) {
		this.taskStatus = taskStatus;
	}

	@Column(name = "IS_AUTO_PUBLISH", precision = 1, scale = 0)
	public Boolean getIsAutoPublish() {
		return this.isAutoPublish;
	}

	public void setIsAutoPublish(Boolean isAutoPublish) {
		this.isAutoPublish = isAutoPublish;
	}

	@Column(name = "TASK_OPER_LOGIN_NAME", length = 64)
	public String getTaskOperLoginName() {
		return this.taskOperLoginName;
	}

	public void setTaskOperLoginName(String taskOperLoginName) {
		this.taskOperLoginName = taskOperLoginName;
	}

	@Column(name = "TASK_OPER_REAL_NAME", length = 64)
	public String getTaskOperRealName() {
		return this.taskOperRealName;
	}

	public void setTaskOperRealName(String taskOperRealName) {
		this.taskOperRealName = taskOperRealName;
	}

	@Column(name = "CREATE_COUNT", precision = 6, scale = 0)
	public Integer getCreateCount() {
		return this.createCount;
	}

	public void setCreateCount(Integer createCount) {
		this.createCount = createCount;
	}

	@Column(name = "ERROR_COUNT", precision = 6, scale = 0)
	public Integer getErrorCount() {
		return this.errorCount;
	}

	public void setErrorCount(Integer errorCount) {
		this.errorCount = errorCount;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "publishTask")
	public Set<OperLog> getOperLogs() {
		return this.operLogs;
	}

	public void setOperLogs(Set<OperLog> operLogs) {
		this.operLogs = operLogs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "publishTask")
	public Set<PublishLog> getPublishLogs() {
		return this.publishLogs;
	}

	public void setPublishLogs(Set<PublishLog> publishLogs) {
		this.publishLogs = publishLogs;
	}
	@Column(name = "TOTAL", precision = 6, scale = 0)
	public Integer getTotal() {
		return total;
	}
	public void setTotal(Integer total) {
		this.total = total;
	}
	

}
